import { logger } from "./server/modules/logger";
logger.log("开始启动");
var net = require('net');
import { config } from "./server/modules/config";
var webServer;
function startRestServer() {
    try {
        require('./server/rest-server');
        require("./server/rest-httpsServer");
        logger.log('Rest启动完成');
    } catch (e) {
        logger.error('Rest启动失败');
        logger.error(e);
        logger.error(e.stack)
    }
}
net.createServer({}, function (client) { }).listen(8878, function () {
    logger.log("启动参数:");
    logger.log(process.env.mpjOptions);
    if (config.fbs) {
        logger.log("启动云同步");
        var syncServer = require('./server/sync-server');
        syncServer.on('ready', function (isReady) {
            logger.log('云同步启动' + (isReady ? '成功' : '失败'));
            logger.log('准备启动Rest');
            startRestServer();
        });
    } else {
        startRestServer();
    }
});
